<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci = & get_instance(); 
	$tournament_id = $this->input->post('tournament_id',TRUE);
	$category_id = $this->input->post('category_id',TRUE);
	
	//$eventCategoryDataArray = $ci->event_category_entity->getArrayIdAndNameOfEventCategory($match_id);
	$EVENT_CATEGORY = $ci->event_category_tournament_entity->init('id',$category_id);	
	$TOURNAMENT = $ci->tournament_entity->init('id',$tournament_id);
	
	$livingEventsList = $ci->event_tournament_entity->getLivingEventOfCategory($category_id);
?>

<form action="<?php echo site_url('admin/dataman/tournament_event/edit_events_submit');?>" name="edit_events_submit" id="edit_events_submit" method="post" enctype="multipart/form-data" >
	<input type="hidden" name="tournament_id" id="tournament_id" value="<?php echo $tournament_id;?>" />
	<input type="hidden" name="category_id" id="category_id" value="<?php echo $category_id;?>" />
	<?php foreach($livingEventsList as $item):?>
		
		<div class="grid2"><span class="bold">Event Category:</span></div>
		<div class="grid6"><?php echo $EVENT_CATEGORY->getCategory(); ?></div>	
		<div class="clrboth"></div>
		
		<div class="grid2"><span class="bold">*Event Name:</span></div>
		<div class="grid6"><input type="text" maxlength="255" name="name[]" value="<?php echo $item->name;?>" class="std-input"/></div>
		<div class="clrboth"></div>
		
		<div class="grid2"><span class="bold">*Odds:</span></div>
		<div class="grid6"><input type="text" maxlength="25" name="odds[]" value="<?php echo $item->odds;?>" class="std-input"/></div>
		<div class="clrboth"></div>
	
		<div class="grid2"><span class="bold">Order:</span></div>
		<div class="grid6"><input type="text" maxlength="5" name="ordering[]" value="<?php echo $item->ordering;?>" class="std-input"/></div>
		<div class="clrboth"></div>
		
		<input type="hidden" name="item_id[]" value="<?php echo $item->id;?>" />
		<div class="grid8" style="border-bottom:1px solid #333333;">&nbsp;</div>
		
		<div class="clrboth"></div>
	<?php endforeach;?>
	
	<div class="grid2">&nbsp;</div>
	<div class="grid6">
		<input type="submit" class="button" /> 
		&nbsp;
		<?php echo loader_image('id="loader_image" class="hidden"');?>
	</div>
	<div class="clrboth"></div>	
	
</form>
